# -*- coding: utf-8 -*-
# @Time    : 2024/5/19 12:01
# @Author  : Alvin
# @File    : db_service.py
from ..services.db_service import Database,Config
from flask import g

def get_db():
    """为蓝图提供数据库连接"""
    db = getattr(g, 'db', None)
    if db is None:
        db = Database(Config.DATABASE)
        g.db = db
    return db